package zulu.test;

import static bogus.core.BogusCore.getInterp;
import hubol.Sprite;

import java.awt.Point;

import owg.util.EntityBase;
import owg.util.opengl.ColorF;
import bogus.core.BogusCore;

public class Mongis extends EntityBase
{
    Point location;
    Sprite spr = new Sprite("randydance");

    public Mongis()
    {
	super(Test.me.list, 0);
	location = new Point();

	location.x = (int)(Math.random()*Test.width/2);
	location.y = (int)(Math.random()*Test.height/2);
    }

    @Override
    public void beginStep()
    {
    }

    @Override
    public void step()
    {
	location.y--;
	if (location.y <= 0)
	    location.y += Test.height;
    }

    @Override
    public void endStep()
    {
    }

    @Override
    public void render()
    {
	BogusCore.egl.setColor(ColorF.RED);
	spr.render(Math.random()*spr.length, location.x, location.y-getInterp(), 0.1f, 0.1f, 0);
	BogusCore.egl.disableTexture2D();
    }
}
